package com.kldy8.kldyw.tools;

/**
 * Created by BG on 2016/4/15.
 */
public class TimeTools
{
    public static long PHPtimeToJAVAtime(long phpTime)
    {
            return  phpTime*1000;
    }

    public static String createTimeExpression(long time)
    {
        long xianggeTime = System.currentTimeMillis() - time;
        if (xianggeTime<86400000)
        {
            if (xianggeTime<3600000)
            {
              int min = (int) (xianggeTime/60000);
                return min+"分钟前";
            }
            else
            {
                int hours = (int) (xianggeTime/3600000);
                return hours+"小时前";
            }
        }
        else
        {
            int day = (int) (xianggeTime/86400000);
            return day+"天前";
        }
    }
}
